home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
rascal.arc
/
ATTRIB.RAS
next >
Wrap
Text File
|
1980-01-01
|
2KB
|
73 lines
' ATTRIB.RAS: Display all screen attributes, modified from
' Peter Norton's book.
INCLUDE SCREEN.INC
INCLUDE INPUT.INC
PROCEDURE MAIN
DO INITIALIZE.SCREEN
DO INITIALIZE.INPUT
L.TITLE$ = "ATTRIB - Display IBM PC Screen Attributes"
R.TITLE$ = "Rascal version 1.05"
DO SET.TITLES
FUNC.MSG$ = "Rascal Example #2"
DO SET.FUNCTION.MSG
DO GET.DISPLAY.TYPE
DO SET.TITLES
DO SET.FUNCTION.MSG
DO BORDERS
DO BUILD.DISPLAY.ARRAY
DO FINISH
ENDPROC
PROCEDURE GET.DISPLAY.TYPE
LOCATE 5,1 : PRINT "Is this a color-graphics display? ";
DO GET.YES.OR.NO
IF ANSWER = YES
SEGVAL! = &HB800 'Color segment
ELSE
SEGVAL! = &HB000 'Monochrome segment
ENDIF
DEF SEG = SEGVAL!
PRINT
ENDPROC
PROCEDURE BORDERS
'Display surrounding messages
LOCATE 11,1 : PRINT "Normal"
LOCATE 12,1 : PRINT "normal"
LOCATE 19,1 : PRINT "Normal"
LOCATE 20,1 : PRINT "blinking"
LOCATE 11,69 : PRINT "Bright"
LOCATE 12,69 : PRINT "normal"
LOCATE 19,69 : PRINT "Bright"
LOCATE 20,69 : PRINT "blinking"
FOR HEX.DIGIT% = 0 TO 15
LOCATE 6,HEX.DIGIT% * 3 + 17
PRINT HEX$(HEX.DIGIT%)
LOCATE HEX.DIGIT% + 8,11
PRINT HEX$(HEX.DIGIT%)
NEXT HEX.DIGIT%
LOCATE ,,0
ENDPROC
PROCEDURE BUILD.DISPLAY.ARRAY
FOR ROW% = 0 TO 15
FOR COL% = 0 TO 15
POKE (ROW% + 7) * 160 + COL% * 6 + 31, ROW% * 16 + COL%
POKE (ROW% + 7) * 160 + COL% * 6 + 33, ROW% * 16 + COL%
POKE (ROW% + 7) * 160 + COL% * 6 + 35, ROW% * 16 + COL%
POKE (ROW% + 7) * 160 + COL% * 6 + 32, 65 ' 65 is char "A"
NEXT COL%
NEXT ROW%
ENDPROC
PROCEDURE FINISH
LINE.24.MSG$ = "Press any key to return to DOS..."
DO SET.LINE.24
DO IN.GET.KEY
DO CLEAR.SCREEN
SYSTEM
ENDPROC